package com.sgcc.system.api.factory;

import com.sgcc.common.core.domain.R;
import com.sgcc.common.core.web.domain.AjaxResult;
import com.sgcc.common.core.web.page.TableDataInfo;
import com.sgcc.system.api.RemoteRoleDeptService;
import com.sgcc.system.api.RemoteUserService;
import com.sgcc.system.api.domain.SysRoleDept;
import com.sgcc.system.api.domain.SysUser;
import com.sgcc.system.api.model.LoginUser;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 用户服务降级处理
 * 
 * @author sgcc
 */
@Component
public class RemoteRoleDeptFallbackFactory implements FallbackFactory<RemoteRoleDeptService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteRoleDeptFallbackFactory.class);

    @Override
    public RemoteRoleDeptService create(Throwable throwable)
    {
        log.error("服务调用失败:{}", throwable.getMessage());
        return new RemoteRoleDeptService()
        {


			@Override
			public R<SysRoleDept> getInfo(String id) {
				return R.fail("ISC查询失败，请稍后再试~");
			}

			@Override
			public R<Integer> add(SysRoleDept sysRoleDept) {
				return R.fail("ISC添加失败，请稍后再试~");
			}

			@Override
			public R<Integer> edit(SysRoleDept sysRoleDept) {
				return R.fail("ISC修改失败，请稍后再试~");
			}

			@Override
			public R<SysRoleDept> findDeptRole(SysRoleDept post) {
				return R.fail("ISC修改失败，请稍后再试~");
			}
		};
    }
}
